iconhelper: Queue resize on invalidation
authorBenjamin Otte <otte@redhat.com>
Mon, 14 Dec 2015 04:29:35 +0000 (05:29 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 15 Dec 2015 13:41:16 +0000 (08:41 -0500)
When things change in the iconhelper, queue a resize on the owner widget
so that it automatically resizes.

Only do this for iconhelpers that are used as gadgets though, not for
temporary helpers - and to check this, check if the node is transient.

gtk/gtkiconhelper.c

index deac87c6610450605c8d31ebb043ebd7542b28a3..cd31bc62a89cf33228cba7e2edbbaac6040e41a4 100644 (file)
@@ -28,6 +28,7 @@
 #include "gtkcssnodeprivate.h"
 #include "gtkcssstyleprivate.h"
 #include "gtkcssstylepropertyprivate.h"
+#include "gtkcsstransientnodeprivate.h"
 #include "gtkiconthemeprivate.h"
 #include "gtkrendericonprivate.h"
 #include "deprecated/gtkiconfactoryprivate.h"
@@ -55,6 +56,9 @@ gtk_icon_helper_invalidate (GtkIconHelper *self)
       cairo_surface_destroy (self->priv->rendered_surface);
       self->priv->rendered_surface = NULL;
     }
+
+  if (!GTK_IS_CSS_TRANSIENT_NODE (gtk_css_gadget_get_node (GTK_CSS_GADGET (self))))
+    gtk_widget_queue_resize (gtk_css_gadget_get_owner (GTK_CSS_GADGET (self)));
 }
 
 static void